package net.mikoo.seals.agent.common.enums;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.StringUtils;

public enum DevicesStatusEnum {

	WAIT_BIND("WAIT_BIND", "待绑定"),

	WAIT_INSTALL("WAIT_INSTALL", "待安装"),
	
	ACTIVATE("ACTIVATE", "已激活"),
	
	;

	/** 枚举值 */
	private final String code;

	/** 枚举描述 */
	private final String message;

	/**
	 * 构造一个<code>ContractStatusEnum</code>枚举对象
	 * 
	 * @param code
	 * @param message
	 */
	private DevicesStatusEnum(String code, String message) {
		this.code = code;
		this.message = message;
	}

	/**
	 * @return Returns the code.
	 */
	public String getCode() {
		return code;
	}

	/**
	 * @return Returns the message.
	 */
	public String getMessage() {
		return message;
	}

	/**
	 * @return Returns the code.
	 */
	public String code() {
		return code;
	}

	/**
	 * @return Returns the message.
	 */
	public String message() {
		return message;
	}

	/**
	 * 通过枚举<code>code</code>获得枚举
	 * 
	 * @param code
	 * @return ContractStatusEnum
	 */
	public static DevicesStatusEnum getByCode(String code) {
		for (DevicesStatusEnum _enum : values()) {
			if (StringUtils.equals(_enum.getCode(), code)) {
				return _enum;
			}
		}
		return null;
	}

	/**
	 * 获取全部枚举
	 * 
	 * @return List<ContractStatusEnum>
	 */
	public List<DevicesStatusEnum> getAllEnum() {
		List<DevicesStatusEnum> list = new ArrayList<DevicesStatusEnum>();
		for (DevicesStatusEnum _enum : values()) {
			list.add(_enum);
		}
		return list;
	}

	/**
	 * 获取全部枚举值
	 * 
	 * @return List<String>
	 */
	public List<String> getAllEnumCode() {
		List<String> list = new ArrayList<String>();
		for (DevicesStatusEnum _enum : values()) {
			list.add(_enum.code());
		}
		return list;
	}

}
